<template>
  <div class="total">
    <div class="top border-bottom">
      课程搜索
    </div>
    <sousuo :hotCities="hotCities"></sousuo>
    <xiangmu></xiangmu>
  </div>
</template>

<script>
import axios from "axios";
import sousuo from "./sousuo/sousuo";
import xiangmu from "./sousuo/xiangmu";
export default {
  name: "course",
  data() {
    return {
      hotCities: []
    };
  },
  components: {
    sousuo,
    xiangmu
  },
  methods: {
    ajax() {
      axios.get("/api/kecheng.json").then(this.shuju);
    },
    shuju(res) {
      res = res.data;
      if (res.ret) {
        res = res.data;
        this.hotCities = res.hotCities;
        // console.log(this.hotCities);
      }
    }
  },
  mounted() {
    this.ajax();
  }
};
</script>

<style scoped>

.top {
  font-size: 1.5rem;
  text-align: center;
  padding: 1rem 0;
  background: #fff;
}
</style>